home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993 April: Penguin on DISC / ADC Developer CD (1993-04) (''Penguin On DISC'')_iso / Dev.CD Apr 93.iso / Utilities / MPW Interfaces 7.1 Beta / AIncludes / PPCToolbox.a < prev    next >
Encoding:
Text File  |  1992-08-28  |  11.8 KB  |  394 lines  |  [TEXT/MPS ]

  1. ; Version: 1.00
  2. ; Created: Friday, October 20, 1989 at 9:35:53 PM
  3. ;
  4. ;      PPCToolbox.a
  5. ;      Assembler Interface to the Macintosh Libraries
  6. ;
  7. ;      Copyright Apple Computer, Inc.  1989-1991
  8. ;      All rights reserved
  9. ;
  10.  
  11.     IF &TYPE('__IncludingPPCToolbox__') = 'UNDEFINED' THEN
  12. __IncludingPPCToolbox__    SET    1
  13.  
  14.     IF &TYPE('__IncludingTraps__') = 'UNDEFINED' THEN       ; get defintion of _Pack9
  15.     INCLUDE 'Traps.a'
  16.     ENDIF
  17.  
  18. ;  PPCCommand Values
  19.  
  20. ;    Trap Selector D0 Must be set to one of the following, csCode will contain this value
  21. ;    when the call completes.
  22.  
  23. ppcInitCmd            EQU            0
  24. ppcOpenCmd            EQU         1
  25. ppcStartCmd           EQU         2
  26. ppcInformCmd          EQU         3
  27. ppcAcceptCmd          EQU         4
  28. ppcRejectCmd          EQU         5
  29. ppcWriteCmd           EQU         6
  30. ppcReadCmd            EQU         7
  31. ppcEndCmd             EQU         8
  32. ppcCloseCmd           EQU         9
  33. IPCListPortsCmd        EQU         10
  34. ppcKillCmd            EQU            11
  35.  
  36. DeleteUserCmd        EQU         12
  37. GetDefaultUserCmd    EQU         13
  38. StartSecureCmd        EQU         14
  39.  
  40. ;    Valid PPCServiceTypes
  41. ppcServiceRealTime    EQU            1
  42.  
  43.  
  44. ;    Valid PPCLocationKinds    =    Integer;
  45. ppcNoLocation        EQU            0 ;    There is no PPCLocName
  46. ppcNBPLocation        EQU            1 ;    Use AppleTalk NBP
  47. ppcNBPTypeLocation    EQU            2 ;    Use just the NBP type, fill in rest with default
  48.  
  49. ;    Valid PPCPortKinds        =    Integer;
  50. ppcByCreatorAndType    EQU            1 ;    Port type is specified as colloquial Mac creator and type
  51. ppcByString         EQU            2 ;    Port type is in pascal string format
  52.  
  53. ;    Valid PPCSessionOrigins    =    SignedByte;    { requestType returned in PPCInform }
  54. ppcLocalOrigin        EQU            1 ;    session originated from this machine
  55. ppcRemoteOrigin        EQU            2 ;    session originated from remote machine
  56.  
  57. PPCPortRec            RECORD    0 ;        TYPE                Comment
  58. nameScript            DS.W    1 ;        ScriptCode;            script of name
  59. name                DS.B    34 ;        Str32;                name of port as seen in browser
  60. portKindSelector    DS.W    1 ;        PPCPortKinds;        which variant
  61. portTypeStr            DS.B    34 ;        Str32;
  62.                     ORG portTypeStr
  63. portCreator            DS.L    1 ;        OSType;
  64. portType            DS.L    1 ;        OSType;
  65.                     ENDR
  66.  
  67. LocationNameRec    RECORD        0 ;
  68. locationKindSelector    DS.W    1 ;    PPCLocationKind;    which variant
  69. nbpEntity                DS.B     100 ;                    NBP name entity
  70.                         ORG nbpEntity ;
  71. nbpType                    DS.B    34 ;    Str32;                just the NBP type string, for PPCOpen
  72.                         ENDR
  73.  
  74.  
  75. PortInfoRec            RECORD    0 ;
  76. filler1                DS.B    1 ;    SignedByte;
  77. authRequired        DS.B    1 ;    Boolean;
  78. name                DS PPCPortRec ;
  79.                     ENDR
  80.                     
  81.                     
  82. PPCOpenPBRec     RECORD    0 ;        TYPE                Comment
  83. qLink            DS.L    1 ;        Ptr                    reserved
  84. csCode            DS.W    1 ;        INTEGER                reserved
  85. intUse            DS.W    1 ;        INTEGER                reserved
  86. intUsePtr        DS.L    1 ;        Ptr                    reserved
  87. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  88. ioResult        DS.W    1 ;        OSErr                Result of operation.
  89. reserved        DS.L    5 ;        LONGINT                reserved
  90. portRefNum        DS.W    1 ;        PPCPortRefNum        Port Reference            
  91. filler1            DS.L    1 ;        LONGINT                ignored            
  92. serviceType        DS.B    1 ;         PPCServiceType        Bit field describing the requested port service
  93. resFlag            DS.B    1 ;        BYTE                Must be set to 0
  94. portName        DS.L    1 ;        PPCPortPtr            PortName for PPC
  95. locationName    DS.L    1 ;        LocationNamePtr        If NBP  Registration is required
  96. networkVisible    DS.B    1 ;         BOOLEAN                make this network visible on network
  97. nbpRegistered    DS.B    1 ;         BOOLEAN                The given location name was registered on the network
  98.                 ENDR
  99.  
  100.  
  101. PPCInformPBRec    RECORD    0 ;        TYPE                Comment
  102. qLink            DS.L    1 ;        Ptr                    reserved
  103. csCode            DS.W    1 ;        INTEGER                reserved
  104. intUse            DS.W    1 ;        INTEGER                reserved
  105. intUsePtr        DS.L    1 ;        Ptr                    reserved
  106. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  107. ioResult        DS.W    1 ;        OSErr                Result of operation.
  108. reserved        DS.L    5 ;        LONGINT                reserved
  109. portRefNum         DS.W    1 ;        PPCPortRefNum        Port Identifier
  110. sessRefNum        DS.L    1 ;        PPCSessRefNum        Session Reference
  111. serviceType        DS.B    1 ;        PPCServiceType        Status Flags for type of session, local, remote
  112. autoAccept         DS.B    1 ;        Boolean                if true session will be accepted automatically
  113. portName        DS.L    1 ;        PPCPortPtr            Buffer for Source PPCPortRec
  114. locationName    DS.L    1 ;        LocationNamePtr        Buffer for Source LocationNameRec
  115. userName        DS.L    1 ;        StringPtr            Buffer for Soure user's name trying to link.
  116. userData        DS.L    1 ;        LongInt                value included in PPCStart's userData
  117. requestType        DS.B    1 ;        PPCSessionOrigin    Local or Network
  118.                 ENDR
  119.  
  120.  
  121. PPCStartPBRec    RECORD    0 ;        TYPE                Comment
  122. qLink            DS.L    1 ;        Ptr                    reserved
  123. csCode            DS.W    1 ;        INTEGER                reserved
  124. intUse            DS.W    1 ;        INTEGER                reserved
  125. intUsePtr        DS.L    1 ;        Ptr                    reserved
  126. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  127. ioResult        DS.W    1 ;        OSErr                Result of operation.
  128. reserved        DS.L    5 ;        LONGINT                reserved
  129. portRefNum:     DS.W    1 ;        PPCPortRefNum;        Port Identifier
  130. sessRefNum:        DS.L    1 ;        PPCSessRefNum;        Session Reference
  131. serviceType:    DS.B    1 ;        PPCServiceType        Actual service method (realTime)
  132. resFlag:         DS.B    1 ;        SignedByte            Must be set to 0
  133. portName:        DS.L    1 ;        PPCPortPtr            Destination portName
  134. locationName:    DS.L    1 ;        LocationNamePtr        NBP or NAS style service location name
  135. rejectInfo:        DS.L    1 ;        LongInt                reason for rejecting the session request
  136. userData:        DS.L    1 ;        LongInt                Copied to destination PPCInform parameter block
  137. userRefNum:        DS.L    1 ;        LongInt                userRefNum (obtained during login process)
  138.                 ENDR
  139.  
  140.  
  141. PPCAcceptPBRec    RECORD    0 ;        TYPE                Comment
  142. qLink            DS.L    1 ;        Ptr                    reserved
  143. csCode            DS.W    1 ;        INTEGER                reserved
  144. intUse            DS.W    1 ;        INTEGER                reserved
  145. intUsePtr        DS.L    1 ;        Ptr                    reserved
  146. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  147. ioResult        DS.W    1 ;        OSErr                Result of operation.
  148. reserved        DS.L    5 ;        LONGINT                reserved
  149. filler1            DS.W    1 ;         Integer                    
  150. sessRefNum        DS.L    1 ;        PPCSessRefNum        Session Reference
  151.                 ENDR
  152.                         
  153.                         
  154. PPCRejectPBRec    RECORD    0 ;        TYPE                Comment
  155. qLink            DS.L    1 ;        Ptr                    reserved
  156. csCode            DS.W    1 ;        INTEGER                reserved
  157. intUse            DS.W    1 ;        INTEGER                reserved
  158. intUsePtr        DS.L    1 ;        Ptr                    reserved
  159. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  160. ioResult        DS.W    1 ;        OSErr                Result of operation.
  161. reserved        DS.L    5 ;        LONGINT                reserved
  162. filler1            DS.W    1 ;         Integer
  163. sessRefNum        DS.L    1 ;        PPCSessRefNum        Session Reference
  164. filler2            DS.W    1 ;        Integer
  165. filler3            DS.L    1 ;        LongInt
  166. filler4            DS.L    1 ;        LongInt
  167. rejectInfo        DS.L    1 ;        LongInt                reason for rejecting the session request
  168.                 ENDR
  169.     
  170.     
  171. PPCWritePBRec    RECORD    0 ;        TYPE                Comment
  172. qLink            DS.L    1 ;        Ptr                    reserved
  173. csCode            DS.W    1 ;        INTEGER                reserved
  174. intUse            DS.W    1 ;        INTEGER                reserved
  175. intUsePtr        DS.L    1 ;        Ptr                    reserved
  176. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  177. ioResult        DS.W    1 ;        OSErr                Result of operation.
  178. reserved        DS.L    5 ;        LONGINT                reserved
  179. filler1            DS.W    1 ;        Integer
  180. sessRefNum        DS.L    1 ;        PPCSessRefNum        Session Reference
  181. bufferLength    DS.L    1 ;        Size                Length of the message buffer
  182. actualLength    DS.L    1 ;        Size                Actual Length Written
  183. bufferPtr        DS.L    1 ;        Ptr                    Pointer to message buffer
  184. more            DS.B    1 ;        Boolean                if more data in this block will be written    
  185. filler2            DS.B    1 ;        SignedByte;                 
  186. userData        DS.L    1 ;        LongInt                Message block userData Uninterpreted by PPC    
  187. blockCreator    DS.L    1 ;        OSType                Message block creator Uninterpreted by PPC    
  188. blockType        DS.L    1 ;        OSType                Message block type Uninterpreted by PPC    
  189.                 ENDR
  190.     
  191.     
  192. PPCReadPBRec    RECORD    0 ;        TYPE                Comment
  193. qLink            DS.L    1 ;        Ptr                    reserved
  194. csCode            DS.W    1 ;        INTEGER                reserved
  195. intUse            DS.W    1 ;        INTEGER                reserved
  196. intUsePtr        DS.L    1 ;        Ptr                    reserved
  197. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  198. ioResult        DS.W    1 ;        OSErr                Result of operation.
  199. reserved        DS.L    5 ;        LONGINT                reserved
  200. filler1            DS.W    1 ;        Integer
  201. sessRefNum        DS.L    1 ;        PPCSessRefNum        Session Reference
  202. bufferLength    DS.L    1 ;        Size                Length of the message buffer
  203. actualLength    DS.L    1 ;        Size                Actual length read
  204. bufferPtr        DS.L    1 ;        Ptr                    Pointer to message buffer
  205. more            DS.B    1 ;        Boolean                if true more data in this block to be read
  206. filler2            DS.B    1 ;        SignedByte
  207. userData        DS.L    1 ;        LongInt                Message block userData Uninterpreted by PPC
  208. blockCreator    DS.L    1 ;        OSType                Message block creator Uninterpreted by PPC
  209. blockType        DS.L    1 ;        OSType                Message block type Uninterpreted by PPC
  210.                 ENDR
  211.     
  212.     
  213. PPCEndPBRec        RECORD    0 ;        TYPE                Comment
  214. qLink            DS.L    1 ;        Ptr                    reserved
  215. csCode            DS.W    1 ;        INTEGER                reserved
  216. intUse            DS.W    1 ;        INTEGER                reserved
  217. intUsePtr        DS.L    1 ;        Ptr                    reserved
  218. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  219. ioResult        DS.W    1 ;        OSErr                Result of operation.
  220. reserved        DS.L    5 ;        LONGINT                reserved
  221. filler1            DS.W    1 ;        Integer                    
  222. sessRefNum        DS.L    1 ;        PPCSessRefNum        Session Reference
  223.                 ENDR
  224.     
  225.     
  226. PPCClosePBRec    RECORD    0 ;        TYPE                Comment
  227. qLink            DS.L    1 ;        Ptr                    reserved
  228. csCode            DS.W    1 ;        INTEGER                reserved
  229. intUse            DS.W    1 ;        INTEGER                reserved
  230. intUsePtr        DS.L    1 ;        Ptr                    reserved
  231. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  232. ioResult        DS.W    1 ;        OSErr                Result of operation.
  233. reserved        DS.L    5 ;        LONGINT                reserved
  234. portRefNum        DS.W    1 ;         PPCPortRefNum        Port Identifier
  235.                 ENDR
  236.     
  237.     
  238. IPCListPortsPBRec    RECORD    0 ;    TYPE                Comment
  239. qLink            DS.L    1 ;        Ptr                    reserved
  240. csCode            DS.W    1 ;        INTEGER                reserved
  241. intUse            DS.W    1 ;        INTEGER                reserved
  242. intUsePtr        DS.L    1 ;        Ptr                    reserved
  243. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  244. ioResult        DS.W    1 ;        OSErr                Result of operation.
  245. reserved        DS.L    5 ;        LONGINT                reserved
  246. filler1            DS.W    1 ;        Integer
  247. startIndex        DS.W    1 ;         Integer                Start Index
  248. requestCount    DS.W    1 ;        Integer                Number of entries to be returned
  249. actualCount        DS.W    1 ;        Integer                Actual Number of entries to be returned
  250. portName        DS.L    1 ;        PPCPortPtr            PortName Match
  251. locationName    DS.L    1 ;        LocationNamePtr        NBP or NAS type name to locate the Port Location
  252. bufferPtr        DS.L    1 ;        PortInfoArrayPtr    Pointer to a buffer requestCount*sizeof(PortInfo) bytes big                            
  253.                 ENDR
  254.     
  255. DeleteUserParams    RECORD     0 ;
  256. userRefNum        DS.L    1 ;        LONGINT
  257.                 ENDR
  258.  
  259. StartSecureParams    RECORD    0 ;    TYPE
  260. prompt            DS.L    1 ;        StringPtr
  261. guestSelected    DS.L    1 ;        pointer to a Boolean
  262. allowGuest        DS.B    1 ;        Boolean
  263. reserved1        DS.B    1 ;        Byte
  264. useDefault        DS.B    1 ;        Boolean
  265. reserved2        DS.B    1 ;        Byte
  266. userName        DS.L    1 ;        StringPtr
  267. startPb            DS.L    1 ;        PPCStartPBPtr
  268.                 ENDR
  269.  
  270. GetDefaultUserParams    RECORD    0 ;
  271. userName        DS.L    1 ;        Pointer to Str32.
  272. userRef            DS.L    1 ;        Pointer to LONGINT.
  273.                 ENDR
  274.  
  275. PPCParamBlockRec    RECORD    0 ;
  276. openParam        DS    PPCOpenPBRec
  277.                 ORG 0
  278. informParam        DS    PPCInformPBRec
  279.                 ORG 0
  280. startParam        DS    PPCStartPBRec
  281.                 ORG 0
  282. acceptParam        DS    PPCAcceptPBRec
  283.                 ORG 0
  284. rejectParam        DS    PPCRejectPBRec
  285.                 ORG 0
  286. writeParam        DS    PPCWritePBRec
  287.                 ORG 0
  288. readParam         DS    PPCReadPBRec
  289.                 ORG 0
  290. endParam        DS    PPCEndPBRec
  291.                 ORG 0
  292. closeParam        DS    PPCClosePBRec
  293.                 ORG 0
  294. listPortsParam    DS    IPCListPortsPBRec
  295.                 ENDR
  296.  
  297.  
  298.  
  299.                   Macro
  300.                   _PPCInit
  301.                   MOVEQ       #ppcInitCmd,D0
  302.                   DC.W        $A0DD
  303.                   Endm
  304.  
  305.                   Macro
  306.                   _DoPPCTrap
  307.                   IF          &SYSLIST[1] = 'SYNC' THEN
  308.                   DC.W        $A0DD
  309.                   ELSE
  310.                   DC.W        $A4DD
  311.                   ENDIF
  312.                   Endm
  313.  
  314.                   Macro
  315.                   _PPCMacro
  316.                   MOVEQ       &SYSLIST[1],D0
  317.                   _DoPPCTrap &SYSLIST[2] 
  318.                   Endm
  319.  
  320.                   Macro
  321.                   _PPCOpen
  322.                   _PPCMacro   #ppcOpenCmd,&SYSLIST[2]
  323.                   Endm
  324.  
  325.                   Macro
  326.                   _PPCInform
  327.                   _PPCMacro   #ppcInformCmd,&SYSLIST[2]
  328.                   Endm
  329.  
  330.                   Macro
  331.                   _PPCStart
  332.                   _PPCMacro   #ppcStartCmd,&SYSLIST[2]
  333.                   Endm
  334.  
  335.                   Macro
  336.                   _PPCAccept
  337.                   _PPCMacro   #ppcAcceptCmd,&SYSLIST[2]
  338.                   Endm
  339.  
  340.                   Macro
  341.                   _PPCReject
  342.                   _PPCMacro   #ppcRejectCmd,&SYSLIST[2]
  343.                   Endm
  344.  
  345.                   Macro
  346.                   _PPCWrite
  347.                   _PPCMacro   #ppcWriteCmd,&SYSLIST[2]
  348.                   Endm
  349.  
  350.                   Macro
  351.                   _PPCRead
  352.                   _PPCMacro   #ppcReadCmd,&SYSLIST[2]
  353.                   Endm
  354.  
  355.                   Macro
  356.                   _PPCClose
  357.                   _PPCMacro   #ppcCloseCmd,&SYSLIST[2]
  358.                   Endm
  359.  
  360.                   Macro
  361.                   _PPCEnd
  362.                   _PPCMacro   #ppcEndCmd,&SYSLIST[2]
  363.                   Endm
  364.  
  365.                   Macro
  366.                   _IPCListPorts
  367.                   _PPCMacro   #IPCListPortsCmd,&SYSLIST[2]
  368.                   Endm
  369.                 
  370.                  Macro
  371.                 _DeleteUserIdentity
  372.                 Moveq    #DeleteUserCmd,D0
  373.                 DC.W    $A0DD
  374.                 Endm
  375.                 
  376.                 Macro
  377.                 _GetDefaultUser
  378.                 Moveq    #GetDefaultUserCmd,D0
  379.                 DC.W    $A0DD
  380.                 Endm
  381.  
  382.                 Macro
  383.                 _StartSecureSession
  384.                 Moveq    #StartSecureCmd,D0
  385.                 DC.W    $A0DD
  386.                 Endm
  387.  
  388.                 Macro
  389.                 _PPCBrowser
  390.                 MOVE.W        #$0D00,D0
  391.                 _Pack9
  392.                   Endm
  393.  
  394.     ENDIF     ;...already included